import moment from 'moment'
// 社保公积金基数管理
export const SocialProvidentBasicDataThead = [
  {
    type: 'selection',
    minWidth: 60,
    fixed: 'left',
    align: 'center'
  },
  {
    title: '员工名称',
    key: 'name',
    minWidth: 150,
    fixed: 'left'
  },
  {
    title: '身份证号码',
    key: 'idCardNo',
    minWidth: 200,
    fixed: 'left'
  },
  {
    title: '公司名称',
    key: 'companyName',
    minWidth: 200
  },
  {
    title: '参保类型',
    key: 'securityTypeName',
    minWidth: 150
  },
  {
    title: '参保编号',
    key: 'securityNO',
    minWidth: 150
  },
  {
    title: '参保方案',
    key: 'planName',
    minWidth: 150
  },
  {
    title: '申报工资',
    key: 'declareSalary',
    minWidth: 150
  },
  {
    title: '新增异动状态',
    key: 'addStatusName',
    minWidth: 150
  },
  {
    title: '新增异动申报时间',
    key: 'add_DeclareDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.add_DeclareDate ? row.add_DeclareDate.slice(0, 10).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '新增异动生效时间',
    key: 'add_EffectDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.add_EffectDate ? row.add_EffectDate.slice(0, 16).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '减少异动状态',
    key: 'reduceStatusName',
    minWidth: 150,
    // render: (h, params) => {
    //   let row = params.row
    //   let times = row.reduceStatusName.slice(0, 16).replace(/T/g, ' ')
    //   return h('span', times)
    // }
  },
  {
    title: '减少异动申报时间',
    key: 'reduce_DeclareDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.reduce_DeclareDate ? row.reduce_DeclareDate.slice(0, 10).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '减少异动生效时间',
    key: 'reduce_EffectDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.reduce_EffectDate ? row.reduce_EffectDate.slice(0, 16).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '创建时间',
    key: 'createdOn',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.createdOn ? row.createdOn.slice(0, 16).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '操作',
    key: 'action',
    slot: 'action',
    minWidth: 150,
    align: 'center',
    fixed: 'right'
  }
]

// 社保明细
export const SocialDetailThead = [
  {
    title: '',
    key: 'null',
    width: 200,
    slot: 'leftnav',
    fixed: 'left'
  },
  {
    title: '养老（单位）',
    key: 'PensionCompanytotalAmount',
    width: 150
  },
  {
    title: '养老（个人）',
    key: 'PensionEmployeetotalAmount',
    width: 150
  },
  {
    title: '医疗（单位）',
    key: 'MedicalCareCompanytotalAmount',
    width: 150
  },
  {
    title: '医疗（个人）',
    key: 'MedicalCareEmployeetotalAmount',
    width: 150
  },
  {
    title: '失业（单位）',
    key: 'UnemploymentCompanytotalAmount',
    width: 150
  },
  {
    title: '失业（个人）',
    key: 'UnemploymentEmployeetotalAmount',
    width: 150
  },
  {
    title: '工伤（单位）',
    key: 'InjuryOnTheJobCompanytotalAmount',
    width: 150
  },
  {
    title: '工伤（个人）',
    key: 'InjuryOnTheJobEmployeetotalAmount',
    width: 150
  }
]

// 商保基数管理
export const CommercialBasicDataThead = [
  {
    type: 'selection',
    minWidth: 60,
    fixed: 'left',
    align: 'center'
  },
  {
    title: '员工名称',
    key: 'name',
    minWidth: 150,
    fixed: 'left'
  },
  {
    title: '身份证号码',
    key: 'idCardNo',
    minWidth: 200,
    fixed: 'left'
  },
  {
    title: '公司名称',
    key: 'companyName',
    minWidth: 200
  },
  {
    title: '商保编号',
    key: 'securityNO',
    minWidth: 150
  },
  {
    title: '商保金额',
    key: 'totalAmount',
    minWidth: 150
  },
  {
    title: '类型',
    key: 'typeName',
    minWidth: 150
  },
  {
    title: '新增异动状态',
    key: 'addStatusName',
    minWidth: 150
  },
  {
    title: '新增异动申报时间',
    key: 'add_DeclareDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.add_DeclareDate ? row.add_DeclareDate.slice(0, 10).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '新增异动生效时间',
    key: 'add_EffectDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.add_EffectDate ? row.add_EffectDate.slice(0, 16).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '减少异动状态',
    key: 'reduceStatusName',
    minWidth: 150
  },
  {
    title: '减少异动申报时间',
    key: 'reduce_DeclareDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.reduce_DeclareDate ? row.reduce_DeclareDate.slice(0, 10).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '减少异动生效时间',
    key: 'reduce_EffectDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.reduce_EffectDate ? row.reduce_EffectDate.slice(0, 16).replace(/T/g, ' ') : ''
      return h('span', times)
    }
  },
  {
    title: '是否可替换',
    key: 'canReplace',
    minWidth: 150,
    render: (h, params) => {
      let row = params.row
      let times = row.canReplace ? '是' : '否'
      return h('span', times)
    }
  },
  {
    title: '查看商保替换历史',
    key: 'lookHistory',
    slot: 'lookHistory',
    minWidth: 150
  },
  {
    title: '初始参保人姓名',
    key: 'first_Name',
    minWidth: 180
  },
  {
    title: '初始参保人身份证号码',
    key: 'first_IdCardNo',
    minWidth: 200
  },
  {
    title: '初始参保时间',
    key: 'firstAdd_DeclareDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.firstAdd_DeclareDate ? moment(row.firstAdd_DeclareDate).format('YYYY-MM-DD') : ''
      return h('span', times)
    }
  },
  {
    title: '创建时间',
    key: 'createdOn',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.createdOn ? moment(row.createdOn).format('YYYY-MM-DD HH:mm') : ''
      return h('span', times)
    }
  }
  // {
  //   title: '操作',
  //   key: 'action',
  //   slot: 'action',
  //   minWidth: 150,
  //   align: 'center'
  // }
]

export const CommercialHistoryThead = [
  {
    title: '姓名',
    key: 'name',
    minWidth: 150
  },
  {
    title: '身份证号码',
    key: 'idCardNo',
    minWidth: 200
  },
  {
    title: '参保时间',
    key: 'add_DeclareDate',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.add_DeclareDate ? moment(row.add_DeclareDate).format('YYYY-MM-DD') : ''
      return h('span', times)
    }
  },
  {
    title: '被替换时间',
    key: 'replaceOn',
    minWidth: 180,
    render: (h, params) => {
      let row = params.row
      let times = row.replaceOn ? moment(row.replaceOn).format('YYYY-MM-DD HH:mm') : ''
      return h('span', times)
    }
  },
  {
    title: '替换人姓名',
    key: 'replace_Name',
    minWidth: 150
  },
  {
    title: '替换人身份证号码',
    key: 'replace_IdCardNo',
    minWidth: 200
  },
]
